import Vue from 'vue'
import VueRouter from 'vue-router'
import Major from '@/views/Major.vue'
import Main from '@/views/Main.vue'
import About from '@/views/About.vue'
import Environment from '@/views/Environment.vue'
import MajorDetail from '@/views/MajorDetail.vue'
import Teacher from '@/views/Teacher.vue'
import TeacherDetail from '@/views/TeacherDetail.vue'
import Recruit from '@/views/Recruit.vue'
import Contact from '@/views/Contact.vue'
import MajorType from '@/views/MajorType.vue'
import International from '@/views/International.vue'

Vue.use(VueRouter)

  const routes = [
    {
      path: '/',
      name: 'index',
      component: Main
    },
    {
      path: '/index',
      name:'Main',
      component: Main
    },
    {
      path:'/major',
      name:'Major',
      component: Major
    },
    {
      path:'/majorDetail',
      name:'MajorDetail',
      component: MajorDetail
    },
    {
      path:'/about',
      name:'About',
      component: About
    },
    {
      path:'/environment',
      name:'Environment',
      component: Environment
    },
    {
      path:'/teacher',
      name:'Teacher',
      component: Teacher
    },
    {
      path:'/teacherDetail',
      name:'TeacherDetail',
      component: TeacherDetail,
    },
    {
      path:'/recruit',
      name:'Recruit',
      component: Recruit,
    },
    {
      path:'/contact',
      name:'Contact',
      component: Contact,
    },
    {
      path:'/majorType',
      name:'MajorType',
      component: MajorType,
    },
    {
      path:'/international',
      name:'International',
      component: International,
    },
]

const router = new VueRouter({
  mode: 'history',
  routes
})

router.afterEach(() => {
  window.scrollTo(0,0)
})

export default router
